//
//  ZZIAPHelper.h
//  zz-IAPHelper
//
//  Created by ZengLiZhi on 2024/4/3.
//

#import <Foundation/Foundation.h>
#import "ZZIAPRequest.h"
NS_ASSUME_NONNULL_BEGIN

@interface SKProductsRequest (ZZIAP)

@property (nonatomic, strong) ZZIAPRequest *zz_request;
@end

@interface SKPayment (ZZIAP)

@property (nonatomic, strong) ZZIAPRequest *zz_request;
@end

typedef void(^ZZIAPRestoreCompletionHandler)(ZZIAPRequestCode code, __nullable id obj);

@interface ZZIAPHelper : NSObject

//当前登录用户标识
@property (nonatomic, strong) NSString *userId;
//恢复成功提示
@property (nonatomic, strong) NSString *restoreSuccessTip;
//没有需要恢复提示
@property (nonatomic, strong) NSString *restoreEmptyTip;

+ (instancetype)sharedInstance;

//发起购买
- (void)request:(ZZIAPRequest *)request;
//恢复购买
- (void)restorePurchases;

//Restore流程回调
@property (nonatomic, strong) ZZIAPRestoreCompletionHandler restoreCompletion;
//code处理，可继承ZZIAPCodeHander设置
@property (nonatomic, strong) ZZIAPHander *iapHander;
@end

NS_ASSUME_NONNULL_END
